package com.shizhan.first.mapper;

import com.shizhan.first.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface StudentMapper extends tk.mybatis.mapper.common.Mapper<Student> {

    @Select("SELECT * FROM student")
    List<Student> getStudent();

//    @Select("SELECT * FROM student where id=${id}")  // $会被sql注入 #不会
    @Select("SELECT * FROM student where id=#{id}")
    Student selectStudent(@Param("id") int id);


}
